﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entity.Car_Rental
{
    public partial class RentalRecord : Entity.EntityBase
    {
        public override object[] PrimaryKey
        {
            get { return new object[] { this.ID }; }
        }

        public override IEnumerable<RuleViolation> GetRuleViolations()
        {
            if (string.IsNullOrEmpty(this.ReturnShop))
                yield return new RuleViolation("请选择门店", "ReturnShop");
            if (string.IsNullOrEmpty(this.ReturnCity))
                yield return new RuleViolation("请选择城市", "ReturnCity");
            if (this.StartTime == DateTime.MinValue)
                yield return new RuleViolation("请选择取车时间", "StartTime");
            if (this.EndTime == DateTime.MinValue)
                yield return new RuleViolation("请选择还车时间", "EndTime");
        }

        public Product Product_Extend { get; set; }
        public Product_Property_R Product_Property_R_Extend { get; set; }
        public UserBases UserBases_Extend { get; set; }

        partial void OnCreated()
        {

            base.IsRealDeleted = false;//假删除
            base.Initialization();//基类的某些属性初始化
            this.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(base.PropertyChangedEvent);//初始实体时，先订阅列修改的事件
        }
    }

    public class RentalRecord_Ext : RentalRecord { }
}
